package com.jishuo.nontax.bean.vo;


import com.jishuo.base.util.StringObject;
import com.jishuo.nontax.bean.bank.BackPayBill;
import com.jishuo.nontax.bean.message.SetBackBill;
import com.jishuo.nontax.bean.message.SetBackBillDeposit;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 退付书表
 *
 * @author hlp
 * @email 1459875748@qq.com
 * @date 2023-02-02 10:13:13
 */
@Data
public class BackpaybillVO implements Serializable {
    private static final long serialVersionUID = 1L;

    //主流水号
    private Long backbillid;
    //退付书票号
    private String backbillnum;
    //行政区划
    private Long cantonid;
    //单位编码
    private Long unitid;
    //项目编码
    private Long itemid;
    //领款人名称
    private String drawman;
    //开户行
    private String drawbank;
    //帐户
    private String drawaccount;
    //银行办理日期
    private String dealdate;
    //银行网点名称
    private String bankstation;
    //代理银行ID
    private Long bankid;
    //金额
    private BigDecimal fund;
    //票据状态（0开票/1作废/2挂失）
    private int billstate;
    //经办日期
    private String writedate;
    //票据种类
    private Long billtypeid;
    //字轨
    private Long keyword;
    //是否银行确认收款
    private int isbankaffirm;
    //银行交易流水号
    private String bankaffirm;
    //
    private Integer issend;
    //
    private Long messageid;
    //发送时间
    private String sendtime;
    //银行核心交易流水号
    private String hxbankaffirm;

    private String accountcode;
//    private String paybankdt;
    private String cantoncode;
    private String cantonname;
    private String unitcode;
    private String unitname;
    private String itemcode;
    private String itemname;
    private String accountname;
    private String bankname;
    private String backbillids;
    private String remark;
    private String backoutname;


    public BackpaybillVO(){}

    public BackpaybillVO(SetBackBill bean){

        if(bean.getBankid()!=null){
            this.bankid = Long.valueOf(bean.getBankid());
        }
        if(bean.getFund()!=null){
            this.fund = new BigDecimal(bean.getFund());
        }
        if(bean.getKeyword()!=null){
            this.keyword = Long.valueOf(bean.getKeyword());
        }
        if(bean.getCantonid()!=null){
            this.cantonid = Long.valueOf(bean.getCantonid());
        }
        if(bean.getUnitid()!=null){
            this.unitid = Long.valueOf(bean.getUnitid());
        }
        if(bean.getItemid()!=null){
            this.itemid = Long.valueOf(bean.getItemid());
        }
        this.drawman = bean.getDrawman();
        this.drawbank = bean.getDrawbank();
        this.drawaccount = bean.getDrawaccount();
        this.backbillnum = bean.getBackbillnum();

    }


    public BackPayBill getBackPayBill(){
        BackPayBill bean = new BackPayBill();
        bean.setAccountcode(this.accountcode);
        bean.setBackbillnum(this.backbillnum);
        bean.setBackbillid(StringObject.objectString(this.backbillid));
        bean.setBankid(StringObject.objectString(this.bankid));
        bean.setBillstate(StringObject.objectString(this.billstate));
        bean.setCantonid(StringObject.objectString(this.cantonid));
        bean.setDrawaccount(this.drawaccount);
        bean.setDrawbank(this.drawbank);
        bean.setDrawman(this.drawman);
        bean.setFund(StringObject.objectString(this.fund));
        bean.setItemid(StringObject.objectString(this.itemid));
        bean.setUnitid(StringObject.objectString(this.unitid));
        bean.setAccountcode(this.accountcode);
        bean.setCantoncode(this.cantoncode);
        bean.setCantonname(this.cantonname);
        bean.setUnitcode(this.unitcode);
        bean.setUnitname(this.unitname);
        bean.setItemcode(this.itemcode);
        bean.setItemname(this.itemname);
        bean.setAccountname(this.accountname);
        bean.setBankname(this.bankname);
        return bean;
    }

    public SetBackBillDeposit getSetBackBillDeposit(){
        SetBackBillDeposit bean = new SetBackBillDeposit();

        bean.setBackbillnum(this.backbillnum);
        bean.setDrawman(this.drawman);
        bean.setDrawbank(this.drawbank);
        bean.setDrawaccount(this.drawaccount);
        bean.setDealdate(this.dealdate);
        bean.setBankstation(this.bankstation);
        bean.setBankaffirm(this.bankaffirm);
        if(this.keyword!=null){
            bean.setKeyword(this.keyword.toString());
        }
        if(this.cantonid!=null){
            bean.setCantonid(this.cantonid.toString());
        }
        if(this.unitid!=null){
            bean.setUnitid(this.unitid.toString());
        }
        if(this.itemid!=null){
            bean.setItemid(this.itemid.toString());
        }
        if(this.bankid!=null){
            bean.setBankid(this.bankid.toString());
        }
        if(this.fund!=null){
            bean.setFund(this.fund.toPlainString());
        }

        return bean;
    }

}
